//封装productItem
class ProductItem{
    //
    id!: number;
    title!: string;
    price!: number;
    inventory!: number;
    constructor(id:number = -1,title:string="",price:number = -1,inventory:number=-1) {
        this.id = id;
        this.title = title;
        this.price = price;
        this.inventory = inventory;
    }
    
    public get Id() : number {
        return this.id
    }
    
}

// let iphone = new ProductItem(1, "IPhone", 5899, 5);
// let xiaomitv = new ProductItem(2, "小米TV", 4899, 10);
// let ipad = new ProductItem(3, "IPad", 2899, 3);

// let all: ProductItem[] = [iphone, xiaomitv, ipad];

export default ProductItem 